﻿using System;
using System.Collections.Generic;
using System.Text;

namespace System.Data.SugarClient
{
	internal class SugarConnectionOption
	{

		internal static class Keywords
		{
			internal const string ApplicationName = "Application Name";
			internal const string ConnectionTimeout = "Connection Timeout";
			internal const string DataSource = "Data Source";
			internal const string UserID = "User ID";
			internal const string Password = "Password";
			internal const string EncryptionKey = "Encryption Key";
			internal const string PageSize = "Page Size";
		}

		internal static class Synonyms
		{
			internal const string Server = "Server";
		}

		internal static class DEFAULT
		{
			internal static string ApplicationName = "SugarClient for ADO.NET";
			internal static int ConnectionTimeout = 180;
			internal static string DataSource = "http://localhost/sugarcrm/";
			internal static string UserID = string.Empty; // "admin";
			internal static string Password = string.Empty; // "password";
			internal static string EncryptionKey = string.Empty; // "password";
			internal static int PageSize = 500;
		}

		private static IDictionary<string, string> SynonymsKeyword = new Dictionary<string, string>();

		static SugarConnectionOption()
		{
			SynonymsKeyword[Synonyms.Server] = Keywords.DataSource;
		}

		private SugarConnectionStringBuilder _innerBuilder = new SugarConnectionStringBuilder();

		#region Properties

		internal string ApplicationName
		{
			get { return this._innerBuilder.ApplicationName; }
			set { this._innerBuilder.ApplicationName = value; }
		}

		internal int ConnectionTimeout
		{
			get { return this._innerBuilder.ConnectionTimeout; }
			set { this._innerBuilder.ConnectionTimeout = value; }
		}

		internal string DataSource
		{
			get { return this._innerBuilder.DataSource; }
			set { this._innerBuilder.DataSource = value; }
		}

		internal string UserID
		{
			get { return this._innerBuilder.UserID; }
			set { this._innerBuilder.UserID = value; }
		}

		internal string Password
		{
			get { return this._innerBuilder.Password; }
			set { this._innerBuilder.Password = value; }
		}

		internal string EncryptionKey
		{
			get { return this._innerBuilder.EncryptionKey; }
			set { this._innerBuilder.EncryptionKey = value; }
		}

		internal int PageSize
		{
			get { return this._innerBuilder.PageSize; }
			set { this._innerBuilder.PageSize = value; }
		}

		internal string ConnectionString
		{
			get { return this._innerBuilder.ConnectionString;}
			set { this._innerBuilder.ConnectionString = value; }
		}

		#endregion

	}
}
